<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/three.js"></script>
</head>
<body>
<script>
    var   sceneWidth=window.innerWidth,
        sceneHeight=window.innerHeight;
    var camera,scene,renderer,cube;
    init();
    animate();
    function init(){
        camera=new THREE.PerspectiveCamera(75,sceneWidth/sceneHeight,1,10000);

        scene=new THREE.Scene();


        renderer=new THREE.WebGLRenderer();
        renderer.setSize(window.innerWidth,window.innerHeight)
        document.body.appendChild(renderer.domElement);
        //创建矩形
        var loader = new THREE.JSONLoader();
        loader.load('./bf109e/bf109e.json', function (geometry, materials) {
            model = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materials));
            scene.add(model);
        });
//        var animation = new THREE.Animation(model, model.geometry.animations[0]);
//        animation.play();
//
//        var clock = new THREE.Clock();
//        function render() {
//            requestAnimationFrame(render);
//            // ....
//            var delta = clock.getDelta();
//            THREE.AnimationHandler.update(delta);
//            // ....
//        }
//        render();

        camera.position.z = 5;
    }

    function animate(){
        requestAnimationFrame(animate);
        renderer.render(scene,camera);
    }

</script>
</body>
</html>